package servlet;
import java.io.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import javax.servlet.*;
@WebServlet("/showDownServlet")
public class ShowDownServlet extends HttpServlet{
    private static final long serialVersionUID=1L;

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        File downLoadFileDir=new File(getServletContext().getRealPath("/uploadFiles"));
        File[] list=downLoadFileDir.listFiles();
        request.setAttribute("fileList",list);
        RequestDispatcher dis=request.getRequestDispatcher("showInfo.jsp");
        dis.forward(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req,resp);
    }
}
